#ifndef X264_ENCODER_H
#define X264_ENCODER_H

extern "C" {
#include <x264.h>
}

#include <cstdio>

class X264Encoder:public EncodeBase {
public:
    X264Encoder(int width, int height, int fps, int bitrate, VideoEncDataObserver* p = nullptr);
    ~X264Encoder();
    virtual void encode(void* data, size_t dataSize, long long pts)override;
private:
    x264_t* encoder_;
    x264_param_t m_param;
    x264_picture_t pic_in_;
    int inputWidth_;
    int inputHeight_;
    VideoEncDataObserver* _ob;
};

#endif // X264_ENCODER_H
